<?php
/**
 * Created by PhpStorm.
 * User: C。
 * Date: 2019/8/13
 * Time: 9:04
 */
namespace app\home\controller;

use app\common\model\Practice as PracticeModel;

/**
 * Practice 修行控制器
 * Class Practice
 * @package app\home\controller
 */
class Practice extends Base
{
    /**
     * [getIndex  获取修行]
     * @param
     * @return json
     * @author [C。]
     */
    public function getIndex()
    {
        $model = new PracticeModel;
        $param = input('param.');
        $map = [];
        $this->getPageAndSize($param);
        try{
            $map['type'] = $param['type'];
            $map['status'] = 1;
            $list = $model->getAllData($map,'id','id,title,img,mp3');
        }catch(\Exception $e){
            systembug($e->getMessage(),2,$this->url);
            return admin_json(-1, '获取失败'.$e->getMessage());
        }
        return admin_json(1, '获取成功',$list);
    }
}